<?php
`git config --global user.name 亭雨落`;
`git config --global user.email 1250581615@qq.com`;
$state=`sc query mysql`;
if(strpos($state,'STOPPED')>0){
    `net start mysql`;
}
$db=new PDO("mysql:host=localhost","root","12qwas");
$db->exec("create database if not exist db2;");
$db->exec("use db2");
$db->exec("create table if not exists users (name varchar(50) primary key,age int)");
$count=$db->exec("delete from users where age>=20");
echo "成功删除了 $count 条记录~\n";
$db->exec("truncate table users");
$count=$db->exec("insert into users (name,age) values ('张三',20),('李四',21),('王五',22)");
echo "成功插入了 $count 条记录~\n";
$count=$db->exec("update users set name='张三丰' where name='张三'");
echo "成功修改了 $count 条记录~\n";
$ps=$db->query("select * from users");
foreach($ps as $row){
    echo "$row[name]   $row[age]\n";
}
